<me:UITMKRF  x:Class="WPFExcelReport.TMKRFABP"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
     xmlns:Localization="clr-namespace:Localization;assembly=Localization"
     xmlns:WF="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
    xmlns:me="clr-namespace:WPFExcelReport"
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UITMKRF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:ClolorGrade  x:Key="cgd"/>
        <ucd:WDColorGrade  x:Key="wdd"/>
        <ucd:YGGrade  x:Key="ygd"/>
    </me:UITMKRF.Resources>
    <Grid Grid.Row="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
       
        <DataGrid  Grid.Row="1" CanUserReorderColumns="True"  
                          FontSize="12"
                          Height="{Binding zAV33Height,ElementName=TV}"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected"  
                          IsSynchronizedWithCurrentItem="True"  
                          ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                           x:Name="dlgMaster" 
                  >
            <DataGrid.Columns>
                <DataGridTextColumn FontSize="14" Foreground="Red" Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=排产机台}}"  Width="Auto" />
                <DataGridTemplateColumn Width="Auto" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Grid >
                                <WrapPanel>
                                    <TextBlock Text="{Binding ABFAUFKRS}"/>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=-}}"/>
                                    <TextBlock Text="{Binding ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}"/>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=-}}"/>
                                    <TextBlock Text="{Binding ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}"/>
                                </WrapPanel>

                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Width="Auto" Header="{Binding Source={Localization:TranslateExtension Word=品种-色号}}" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Grid >
                                <WrapPanel>
                                    <TextBlock Text="{Binding ABPART, Converter={StaticResource ResourceKey=trim}}"/>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=-}}"/>
                                    <TextBlock Text="{Binding ABPFARBE, Converter={StaticResource ResourceKey=trim}}"/>
                                </WrapPanel>

                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Path=JOBTYPE}" Header="{Binding Source={Localization:TranslateExtension Word=状态}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABPBESCHICH}" Header="{Binding Source={Localization:TranslateExtension Word=整理}}"  Width="40" />
                <DataGridTextColumn Binding="{Binding Path=JP01}" Header="{Binding Source={Localization:TranslateExtension Word=设置}}"  Width="Auto" />
                <DataGridTemplateColumn Width="40" Header="{Binding Source={Localization:TranslateExtension Word=温度}}" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Grid >
                                <TextBlock  Text="{Binding JP02}" TextAlignment="Center"   Width="40" >
                                    <TextBlock.Background>
                                        <SolidColorBrush Color="{Binding JP02,Converter={StaticResource ResourceKey=wdd}}"></SolidColorBrush>
                                    </TextBlock.Background>
                                </TextBlock>
                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Path=JP03}" Header="{Binding Source={Localization:TranslateExtension Word=配方}}"  Width="Auto" />
                <DataGridTemplateColumn Width="40" Header="{Binding Source={Localization:TranslateExtension Word=荧光}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Grid >

                                <TextBlock  Text="{Binding JP04}"   TextAlignment="Center" Width="40" >
                                    <TextBlock.Background>
                                        <SolidColorBrush Color="{Binding JP04,Converter={StaticResource ResourceKey=ygd}}"></SolidColorBrush>
                                    </TextBlock.Background>
                                </TextBlock>
                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Path=JP05}" Header="{Binding Source={Localization:TranslateExtension Word=步骤交期}}"  Width="Auto" />
                <DataGridTemplateColumn Width="40" Header="{Binding Source={Localization:TranslateExtension Word=色阶}}">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Grid >
                                <TextBlock  Text="{Binding JP06}"    TextAlignment="Center" Width="40" >
                                    <TextBlock.Background>
                                        <SolidColorBrush Color="{Binding JP06,Converter={StaticResource ResourceKey=cgd}}"></SolidColorBrush>
                                    </TextBlock.Background>
                                </TextBlock>
                            </Grid>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Binding="{Binding Path=TPAUTO}" Header="{Binding Source={Localization:TranslateExtension Word=首车}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFTP, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=分批}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFSMG1,Converter={StaticResource d100}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Foreground="Red" Header="{Binding Source={Localization:TranslateExtension Word=排产开始}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFPLTIME}"    Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=ENDTIME}"    Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFAMASCHZT}" Header="{Binding Source={Localization:TranslateExtension Word=分钟}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFBASMGE,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=m/min}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABFSOLLSTART}" Header="{Binding Source={Localization:TranslateExtension Word= 实际}}"  Width="Auto" />
                <DataGridTextColumn Foreground="Green" Binding="{Binding Path=ABFMLFDNR}" Header="{Binding Source={Localization:TranslateExtension Word=上机}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFSMG1,Converter={StaticResource d100}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAID}" Header="{Binding Source={Localization:TranslateExtension Word=ABAID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=MKFSME}" Header="{Binding Source={Localization:TranslateExtension Word=MKFSME}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP30}" Header="{Binding Source={Localization:TranslateExtension Word=车号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP31,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=机型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP32,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=整理方法}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JP33,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=分色}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UITMKRF>
